import time

from base.BasePage import BasePage
from selenium.webdriver.common.by import By
from common.Tools import Tools


class AdminLoginPage(BasePage):
    def __init__(self,driver):
        super().__init__(driver)

    # 管理员登录
    def login(self,username,passeord,vertify):
        self.input_text(self.find_ele((By.NAME, "username")), username)
        self.input_text(self.find_ele((By.NAME, "password")), passeord)
        self.input_text(self.find_ele((By.ID, "vertify")), vertify)
        self.find_ele((By.NAME, "submit")).click()



if __name__ == '__main__':
    driver = Tools.web_driver()
    driver.get("http://hmshop-test.itheima.net/admin")
    admin = AdminLoginPage()
    admin.login("admin", "HM_2025_test", 8888)
    time.sleep(2)
    driver.quit()

